#include <stdio.h>

#define TRACE(x...) 
#define PRINT(x...) TRACE(printf(x))

#define uint unsigned int

int tam=0;
int n;
uint vec[10010];

int main() {
	while (scanf("%u", &n)!=EOF) {
		if (!tam) {
			vec[0]=n; tam=1;
		}
		else {
			for (int i=tam-1; i>=0; i--) {
				if (n<vec[i]) {
					vec[i+1]=vec[i];
				}
				else {
					vec[i+1]=n; break;
				}
			}

			tam++;
		}

		if (tam%2==0) { 
			PRINT("%d %d\n", vec[tam/2], vec[tam/2-1]);
			printf("%u\n", (vec[tam/2]+vec[tam/2-1])/2);
		}
		else
			printf("%u\n", vec[tam/2]);
	}

	return 0;
}
